<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>编辑员工信息</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            max-width: 600px;
            margin: 0 auto;
            padding: 20px;
        }
        .form-container {
            background-color: #f8f9fa;
            padding: 25px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        .form-group {
            margin-bottom: 15px;
        }
        label {
            display: block;
            margin-bottom: 5px;
            font-weight: 500;
        }
        input[type="text"],
        input[type="number"] {
            width: 100%;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }
        button[type="submit"] {
            background-color: #007bff;
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            width: 100%;
        }
        button[type="submit"]:hover {
            background-color: #0056b3;
        }
        .back-link {
            margin-top: 20px;
            display: inline-block;
            color: #007bff;
            text-decoration: none;
        }
        .back-link:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
<div class="form-container">
    <h2>编辑员工信息</h2>

    <!-- 错误提示 -->
    <div th:if="${error}" style="color: red; margin-bottom: 15px;" th:text="${error}"></div>

    <!-- 编辑表单 -->
    <form action="EditEmployeeServlet" method="post">
        <!-- 隐藏字段传递员工ID -->
        <input type="hidden" name="employeeid" th:value="${employee.employeeid}">

        <div class="form-group">
            <label>员工姓名：</label>
            <input type="text" name="employeename"
                   th:value="${employee.employeename}"
                   required placeholder="请输入员工姓名">
        </div>

        <div class="form-group">
            <label>员工工资：</label>
            <input type="number" step="0.01" name="employeesalary"
                   th:value="${employee.employeesalary}"
                   required placeholder="请输入员工工资">
        </div>

        <button type="submit">保存修改</button>
    </form>

    <!-- 返回列表链接 -->
    <p class="back-link">
        <a href="GetAllEmployeeServlet">返回员工列表</a>
    </p>
</div>
</body>
</html>